+2004-03-08 Federico Mena Quintero <federico@ximian.com>
+
+ Fixes #136105.
+
+ * gtk/gtkfilechooserembed.h (struct _GtkFileChooserEmbedIface):
+ Added an ::initial_focus() method.
+
+ * gtk/gtkfilechooserembed.c
+ (_gtk_file_chooser_embed_delegate_iface_init): Set the
+ initial_focus method.
+ (delegate_initial_focus): Implement.
+ (_gtk_file_chooser_embed_initial_focus): New function.
+
+ * gtk/gtkfilechooserdialog.c
+ (gtk_file_chooser_dialog_constructor): Call
+ _gtk_file_chooser_embed_initial_focus().
+
+ * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_init):
+ Install the ::initial_focus() handler.
+ (gtk_file_chooser_default_initial_focus): Implement.
+
2004-03-08 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c (update_from_entry): Return a
+2004-03-08 Federico Mena Quintero <federico@ximian.com>
+
+ Fixes #136105.
+
+ * gtk/gtkfilechooserembed.h (struct _GtkFileChooserEmbedIface):
+ Added an ::initial_focus() method.
+
+ * gtk/gtkfilechooserembed.c
+ (_gtk_file_chooser_embed_delegate_iface_init): Set the
+ initial_focus method.
+ (delegate_initial_focus): Implement.
+ (_gtk_file_chooser_embed_initial_focus): New function.
+
+ * gtk/gtkfilechooserdialog.c
+ (gtk_file_chooser_dialog_constructor): Call
+ _gtk_file_chooser_embed_initial_focus().
+
+ * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_init):
+ Install the ::initial_focus() handler.
+ (gtk_file_chooser_default_initial_focus): Implement.
+
2004-03-08 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c (update_from_entry): Return a
+2004-03-08 Federico Mena Quintero <federico@ximian.com>
+
+ Fixes #136105.
+
+ * gtk/gtkfilechooserembed.h (struct _GtkFileChooserEmbedIface):
+ Added an ::initial_focus() method.
+
+ * gtk/gtkfilechooserembed.c
+ (_gtk_file_chooser_embed_delegate_iface_init): Set the
+ initial_focus method.
+ (delegate_initial_focus): Implement.
+ (_gtk_file_chooser_embed_initial_focus): New function.
+
+ * gtk/gtkfilechooserdialog.c
+ (gtk_file_chooser_dialog_constructor): Call
+ _gtk_file_chooser_embed_initial_focus().
+
+ * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_init):
+ Install the ::initial_focus() handler.
+ (gtk_file_chooser_default_initial_focus): Implement.
+
2004-03-08 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c (update_from_entry): Return a
+2004-03-08 Federico Mena Quintero <federico@ximian.com>
+
+ Fixes #136105.
+
+ * gtk/gtkfilechooserembed.h (struct _GtkFileChooserEmbedIface):
+ Added an ::initial_focus() method.
+
+ * gtk/gtkfilechooserembed.c
+ (_gtk_file_chooser_embed_delegate_iface_init): Set the
+ initial_focus method.
+ (delegate_initial_focus): Implement.
+ (_gtk_file_chooser_embed_initial_focus): New function.
+
+ * gtk/gtkfilechooserdialog.c
+ (gtk_file_chooser_dialog_constructor): Call
+ _gtk_file_chooser_embed_initial_focus().
+
+ * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_init):
+ Install the ::initial_focus() handler.
+ (gtk_file_chooser_default_initial_focus): Implement.
+
2004-03-08 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c (update_from_entry): Return a
+2004-03-08 Federico Mena Quintero <federico@ximian.com>
+
+ Fixes #136105.
+
+ * gtk/gtkfilechooserembed.h (struct _GtkFileChooserEmbedIface):
+ Added an ::initial_focus() method.
+
+ * gtk/gtkfilechooserembed.c
+ (_gtk_file_chooser_embed_delegate_iface_init): Set the
+ initial_focus method.
+ (delegate_initial_focus): Implement.
+ (_gtk_file_chooser_embed_initial_focus): New function.
+
+ * gtk/gtkfilechooserdialog.c
+ (gtk_file_chooser_dialog_constructor): Call
+ _gtk_file_chooser_embed_initial_focus().
+
+ * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_init):
+ Install the ::initial_focus() handler.
+ (gtk_file_chooser_default_initial_focus): Implement.
+
2004-03-08 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c (update_from_entry): Return a
gboolean *resize_horizontally,
gboolean *resize_vertically);
static gboolean gtk_file_chooser_default_should_respond (GtkFileChooserEmbed *chooser_embed);
+static void gtk_file_chooser_default_initial_focus (GtkFileChooserEmbed *chooser_embed);
static void location_popup_handler (GtkFileChooserDefault *impl);
static void up_folder_handler (GtkFileChooserDefault *impl);
iface->get_default_size = gtk_file_chooser_default_get_default_size;
iface->get_resizable_hints = gtk_file_chooser_default_get_resizable_hints;
iface->should_respond = gtk_file_chooser_default_should_respond;
+ iface->initial_focus = gtk_file_chooser_default_initial_focus;
}
static void
gtk_file_chooser_default_init (GtkFileChooserDefault *impl)
return FALSE;
}
+/* Implementation for GtkFileChooserEmbed::initial_focus() */
+static void
+gtk_file_chooser_default_initial_focus (GtkFileChooserEmbed *chooser_embed)
+{
+ GtkFileChooserDefault *impl;
+ GtkWidget *widget;
+
+ impl = GTK_FILE_CHOOSER_DEFAULT (chooser_embed);
+
+ if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN
+ || impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
+ widget = impl->browse_files_tree_view;
+ else if (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
+ || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+ widget = impl->save_file_name_entry;
+ else
+ {
+ g_assert_not_reached ();
+ widget = NULL;
+ }
+
+ gtk_widget_grab_focus (widget);
+}
+
static void
set_current_filter (GtkFileChooserDefault *impl,
GtkFileFilter *filter)
else
priv->widget = g_object_new (GTK_TYPE_FILE_CHOOSER_WIDGET, NULL);
+ _gtk_file_chooser_embed_initial_focus (GTK_FILE_CHOOSER_EMBED (priv->widget));
+
g_signal_connect (priv->widget, "file-activated",
G_CALLBACK (file_chooser_widget_file_activated), object);
g_signal_connect (priv->widget, "default-size-changed",
gboolean *resize_horizontally,
gboolean *resize_vertically);
static gboolean delegate_should_respond (GtkFileChooserEmbed *chooser_embed);
+static void delegate_initial_focus (GtkFileChooserEmbed *chooser_embed);
static void delegate_default_size_changed (GtkFileChooserEmbed *chooser_embed,
gpointer data);
iface->get_default_size = delegate_get_default_size;
iface->get_resizable_hints = delegate_get_resizable_hints;
iface->should_respond = delegate_should_respond;
+ iface->initial_focus = delegate_initial_focus;
}
/**
return _gtk_file_chooser_embed_should_respond (get_delegate (chooser_embed));
}
+static void
+delegate_initial_focus (GtkFileChooserEmbed *chooser_embed)
+{
+ return _gtk_file_chooser_embed_initial_focus (get_delegate (chooser_embed));
+}
+
static void
delegate_default_size_changed (GtkFileChooserEmbed *chooser_embed,
gpointer data)
return GTK_FILE_CHOOSER_EMBED_GET_IFACE (chooser_embed)->should_respond (chooser_embed);
}
+void
+_gtk_file_chooser_embed_initial_focus (GtkFileChooserEmbed *chooser_embed)
+{
+ g_return_if_fail (GTK_IS_FILE_CHOOSER_EMBED (chooser_embed));
+
+ GTK_FILE_CHOOSER_EMBED_GET_IFACE (chooser_embed)->initial_focus (chooser_embed);
+}
+
void
_gtk_file_chooser_embed_get_resizable_hints (GtkFileChooserEmbed *chooser_embed,
gboolean *resize_horizontally,
gboolean *resize_vertically);
gboolean (*should_respond) (GtkFileChooserEmbed *chooser_embed);
+
+ void (*initial_focus) (GtkFileChooserEmbed *chooser_embed);
/* Signals
*/
void (*default_size_changed) (GtkFileChooserEmbed *chooser_embed);
gboolean _gtk_file_chooser_embed_should_respond (GtkFileChooserEmbed *chooser_embed);
+void _gtk_file_chooser_embed_initial_focus (GtkFileChooserEmbed *chooser_embed);
+
void _gtk_file_chooser_embed_delegate_iface_init (GtkFileChooserEmbedIface *iface);
void _gtk_file_chooser_embed_set_delegate (GtkFileChooserEmbed *receiver,
GtkFileChooserEmbed *delegate);